package performance;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Random;

import org.javanum.number.Complex;

public abstract class ComplexRuntimeTest extends PerformanceTest<Complex, Long> {

	@Override
	public abstract void runTest(DataCollector<Long> resultCatcher);
	
	@SuppressWarnings({"WeakerAccess"})
    protected static Collection<Complex> generateData(){
		int DATA_SIZE=100;
		Collection<Complex> data = new ArrayList<Complex>(DATA_SIZE);
		
		Random random = new Random();
		for(int i=0;i<=DATA_SIZE;i++){
			int scale = random.nextInt();
			double real = random.nextDouble()*scale;
			double imag = random.nextDouble()*scale;
			
			data.add(Complex.valueOf(real,imag));
		}
		
		return data;
	}

}
